import Vue from 'vue'

import 'normalize.css/normalize.css' // A modern alternative to CSS resets

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import locale from 'element-ui/lib/locale/lang/en' // lang i18n

import VueAMap from 'vue-amap';
Vue.use(VueAMap);

import '@/styles/index.scss' // global css 

// 系统初始化--静态配置加载
import '../static/conf/sysconf.js'

import App from './App'
import router from './router'

import store from './store'
import filters from './utils/filter' // 全局过滤器

import '@/icons' // icon
import '@/permission' // permission control
import fetch from '@/utils/fetch'
import {api} from '@/utils/constant'

Vue.use(ElementUI, { locale })

Vue.config.productionTip = false

Vue.prototype.$fetch = fetch
Vue.prototype.$api = api

VueAMap.initAMapApiLoader({
  key: '0d75da712be4818001103fca051fd525',
  plugin: ['AMap.Autocomplete', 'AMap.PlaceSearch', 'AMap.Scale', 'AMap.OverView', 'AMap.ToolBar', 'AMap.MapType', 'AMap.PolyEditor', 'AMap.CircleEditor']
})

Object.keys(filters).forEach(key => { // 全局注册过滤器
  Vue.filter(key, filters[key])
}) 

new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App)
})
